<?php

namespace Nim\Bundle\ModelBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Vendor
 *
 * @ORM\Table(name="vendor")
 * @ORM\Entity
 */
class Vendor
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=50)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="string", length=255)
     */
    private $description;

    /**
     * @ORM\OneToMany(targetEntity="Campain", mappedBy="vendor")
     */
    private $campains;
    
    /**
     * @ORM\OneToMany(targetEntity="Product", mappedBy="vendor")
     */
    private $products;
    
    /**
     * @ORM\ManyToMany(targetEntity="Reseller", mappedBy="vendors")
     **/
    private $resellers;
    
    public function __construct()
    {
    	$this->campains = new ArrayCollection();
    	$this->products = new ArrayCollection();
    	$this->resellers = new ArrayCollection();
    }
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Vendor
     */
    public function setName($name)
    {
        $this->name = $name;
    
        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set description
     *
     * @param string $description
     * @return Vendor
     */
    public function setDescription($description)
    {
        $this->description = $description;
    
        return $this;
    }

    /**
     * Get description
     *
     * @return string 
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Add campains
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Campain $campains
     * @return Vendor
     */
    public function addCampain(\Nim\Bundle\ModelBundle\Entity\Campain $campains)
    {
        $this->campains[] = $campains;
    
        return $this;
    }

    /**
     * Remove campains
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Campain $campains
     */
    public function removeCampain(\Nim\Bundle\ModelBundle\Entity\Campain $campains)
    {
        $this->campains->removeElement($campains);
    }

    /**
     * Get campains
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getCampains()
    {
        return $this->campains;
    }

    /**
     * Add products
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Product $products
     * @return Vendor
     */
    public function addProduct(\Nim\Bundle\ModelBundle\Entity\Product $products)
    {
        $this->products[] = $products;
    
        return $this;
    }

    /**
     * Remove products
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Product $products
     */
    public function removeProduct(\Nim\Bundle\ModelBundle\Entity\Product $products)
    {
        $this->products->removeElement($products);
    }

    /**
     * Get products
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getProducts()
    {
        return $this->products;
    }

    /**
     * Add resellers
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Reseller $resellers
     * @return Vendor
     */
    public function addReseller(\Nim\Bundle\ModelBundle\Entity\Reseller $resellers)
    {
        $this->resellers[] = $resellers;
    
        return $this;
    }

    /**
     * Remove resellers
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Reseller $resellers
     */
    public function removeReseller(\Nim\Bundle\ModelBundle\Entity\Reseller $resellers)
    {
        $this->resellers->removeElement($resellers);
    }

    /**
     * Get resellers
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getResellers()
    {
        return $this->resellers;
    }
}